import time
import functools
def time_cost_caculate(fun):
    @functools.wraps(fun)
    def wrapper(*args,**kwargs):
        # print ('the function  %s start now:' % fun.__name__)
        start= time.time()
        try:
            fun(*args,**kwargs)
            end=time.time()
            runtime=end-start
            m, s = divmod(runtime, 60)
            h, m = divmod(m, 60)
            # print ("%02d h:%02d m:%02d s" % (h, m, s))
            print(('the function  %s run cost: %02d h:%02d m:%02d s' % (fun.__name__,h,m,s)))
        except Exception as e:
            print("decorate run fail!(%s)"%e)
        finally:
            pass
    return wrapper